package com.az.zhaotao.wxqf;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;


/**
 * Created by ZhaoTao on 2017/12/29.
 */

public class BigImageActivity   extends Activity {
    private ImageView qrView;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.activity_bigimage);
        //取消状态栏
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_bigimage);

        qrView = findViewById(R.id.bigQrView);

        Intent intent = getIntent();
        //从Intent当中根据key取得value
        if (intent != null) {
            byte [] bitmapByte= intent.getByteArrayExtra("bitmap");
            Bitmap bitmap= BitmapFactory.decodeByteArray(bitmapByte, 0, bitmapByte.length);
            qrView.setImageBitmap(bitmap);
        }

        qrView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                BigImageActivity.this.finish();
            }
        });

    }

    @Override
    public void finish() {
        super.finish();
        overridePendingTransition(android.R.anim.fade_in,android.R.anim.fade_out);
    }
}
